<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
        "https://raw.githubusercontent.com/rbatis/rbatis/master/rbatis-codegen/mybatis-3-mapper.dtd">
<mapper>
    <update id="remove_mcp_server_id">
        UPDATE knowledge_base
        set mcp_server_ids = '[' ||
                             trim(replace(replace(',' || SUBSTR(mcp_server_ids, 2, LENGTH(mcp_server_ids) - 2) || ',',
                                                  ',' || #{mcp_server_id} || ',', ','),
                                          ',,',
                                          ','), ',') || ']'
        where mcp_server_ids like '%' || #{mcp_server_id} || '%'
    </update>
</mapper>